﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wucAdvertList.ascx.cs" Inherits="Modules_WebsiteBackEnd_wucAdvertList" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:UpdatePanel ID="UpdatePanelList" runat="server">
    <ContentTemplate>
        <table align="center" border="0" cellpadding="0" cellspacing="0" width="790px" class="TableGrayBorder">
            <tbody>                
                <tr>
                    <td align="center">
                        <telerik:RadGrid ID="rgrdGridDataList" runat="server" Skin="WebBlue" Width="790px"
                            PageSize="20" AllowMultiRowSelection="true" AllowPaging="True" ShowGroupPanel="false"
                            AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
                            BorderWidth="0px" GridLines="None" AutoGenerateColumns="false"  
                            OnPageIndexChanged="rgrdGridDataList_PageIndexChanged"
                            AllowSorting="false" OnItemCommand="rgrdGridDataList_ItemCommand" OnItemDataBound="rgrdGridDataList_ItemDataBound">
                            <ClientSettings EnablePostBackOnRowClick="True">
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <PagerStyle Mode="NextPrevAndNumeric" NextPagesToolTip="Trang sau" NextPageToolTip="Trang sau"
                                PagerTextFormat="Lựa chọn trang: {4} &amp;nbsp;Trang {0} / {1}, bản ghi {2} - {3} / {5}."
                                PrevPagesToolTip="Trang trước" PrevPageToolTip="Trang trước" />
                            <MasterTableView DataKeyNames="AdId">
                                <RowIndicatorColumn Visible="False">
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn Resizable="False" Visible="False">
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <EditFormSettings>
                                    <PopUpSettings ScrollBars="None" />
                                </EditFormSettings>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="AdId" HeaderText="ID" ReadOnly="True"
                                        UniqueName="AdId">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" Width="40px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="AdName" HeaderText="QUẢNG CÁO"
                                        UniqueName="AdName" ReadOnly="true" ItemStyle-HorizontalAlign="left">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle Width="100px" HorizontalAlign=Left />
                                    </telerik:GridBoundColumn>                                    
                                    <telerik:GridBoundColumn DataField="AdUrl" HeaderText="URL" UniqueName="AdUrl" ReadOnly=true>
                                        <HeaderStyle HorizontalAlign="center" />
                                        <ItemStyle Width="100" HorizontalAlign=Left />
                                    </telerik:GridBoundColumn>                                   
                                    <telerik:GridBoundColumn DataField="AdBeginDate" HeaderText="NGÀY BĐ" UniqueName="AdBeginDate"
                                        ReadOnly="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px" DataFormatString="{0:dd/MM/yyyy}"
                                        HeaderStyle-HorizontalAlign="center">
                                    </telerik:GridBoundColumn>                                                                   
                                    <telerik:GridBoundColumn DataField="AdEndDate" HeaderText="NGÀY KT" UniqueName="AdEndDate"
                                        ReadOnly="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px" DataFormatString="{0:dd/MM/yyyy}"
                                        HeaderStyle-HorizontalAlign="center">
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="AdPosition" HeaderText="VỊ TRÍ" UniqueName="AdPosition" ReadOnly=true>
                                        <HeaderStyle HorizontalAlign="center" />
                                        <ItemStyle Width="40" HorizontalAlign=Center />
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="IsActive" HeaderText="TÌNH TRẠNG" UniqueName="IsActive" ReadOnly=false>
                                        <HeaderStyle HorizontalAlign="center" />
                                        <ItemStyle Width="40" HorizontalAlign=Left />
                                    </telerik:GridBoundColumn>  
                                    <telerik:GridBoundColumn DataField="FileUrl" HeaderText="FILE" UniqueName="FileUrl" ReadOnly=true>
                                        <HeaderStyle HorizontalAlign="center" />
                                        <ItemStyle Width="120" HorizontalAlign=Left />
                                    </telerik:GridBoundColumn>                                                                                                                      
                                    <telerik:GridClientSelectColumn UniqueName="SelectRow" CommandName="RowClick">
                                        <HeaderStyle HorizontalAlign="Center"/>
                                        <ItemStyle HorizontalAlign="Center"  Width="25px"/>
                                    </telerik:GridClientSelectColumn>                                                                        
                                    <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/icons/editrow.png" UniqueName="SubjectEdit" CommandName="RowEdit" Text="Sửa">
                                        <ItemStyle CssClass="MyImageButton"  HorizontalAlign="Center" Width="25px" />
                                    </telerik:GridButtonColumn>                                    
                                    <telerik:GridButtonColumn ConfirmText="Bạn có muốn xóa bản ghi được lựa chọn?" ConfirmDialogType="RadWindow" 
                                        ConfirmTitle="X&#243;a bản ghi" ButtonType="ImageButton" CommandName="RowDelete" Text="X&#243;a" ImageUrl="~/Images/icons/recyclebin.png"
                                        UniqueName="SubjectDelete">
                                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" Width="25px" />
                                    </telerik:GridButtonColumn>
                                    <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/icons/publishingsmall.png"
                                        UniqueName="NewsPublish" CommandName="RowPublish" Text="Lên trang">
                                        <ItemStyle CssClass="MyImageButton" HorizontalAlign="Center" Width="24px" />
                                    </telerik:GridButtonColumn>
                                    <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/icons/Unpublish.png"
                                        UniqueName="NewsUnPublish" CommandName="RowUnPublish" Text="Gỡ xuống">
                                        <ItemStyle CssClass="MyImageButton" HorizontalAlign="Center" Width="24px" />
                                    </telerik:GridButtonColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </td>
                </tr>
            </tbody>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>